package com.scy.controller;

import com.scy.service.BookService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * 本类用来演示
 *
 * @author wwh
 * @date 2024/7/4 11:33 $
 */
@Controller
@RequestMapping("/user")
public class BookController {

    @Resource
    BookService bookService;

    @GetMapping("/del/{bookId}")
    public String delBook(@PathVariable Long bookId){

        boolean result = bookService.delBook(bookId);

        return "redirect:/init";
    }
}
